package com.zking.web.lsc;


import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.zking.dao.domain.Information;
import com.zking.dao.domain.Post;
import com.zking.service.lsc.GSService;
@Controller
public class Inweb {
	@Autowired
	private GSService gSService;

	
	@RequestMapping(value = "/lss1")
	public ModelAndView gs( HttpServletRequest request) {
		ModelAndView modelAndView = new ModelAndView();
		List<Information> l1 = gSService.gs();
		if (l1 != null) {
			modelAndView.addObject("information", l1);
			modelAndView.setViewName("/companylist");
		} 
		
		
		return modelAndView;
	}
	@RequestMapping(value = "/lss2")
	public ModelAndView mn(String com_city, HttpServletRequest request) {
		ModelAndView modelAndView = new ModelAndView();
		List<Information> l2= gSService.mn(com_city); 
		if (l2 != null) {
			modelAndView.addObject("information", l2);
			modelAndView.setViewName("/companylist");
		} 
		
		return modelAndView;
	}
	
	@RequestMapping(value = "/lss3")
	public ModelAndView mw( HttpServletRequest request) {
		ModelAndView modelAndView = new ModelAndView();
		List<Post> l1 = gSService.mw();
		if (l1 != null) {
			modelAndView.addObject("post", l1);
			modelAndView.setViewName("/companylist");
		} else {
		}
		return modelAndView;
	}
	
//	@RequestMapping(value = "/qw")
//	public ModelAndView dq(String com_city, HttpServletRequest request) {
//		ModelAndView modelAndView = new ModelAndView();
//		List<Information> dq = gSService.dq(com_city);
//		if (dq !=null) {
//			modelAndView.addObject("information",dq);
//			modelAndView.setViewName("companylist");
//		}else {
//			
//			System.out.println("无数据");
//		}
//		return modelAndView;
//	}
//	
}
